package com.breeze.components.web.config;

import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 环境配置
 *
 * @author breeze
 */
@Component
@Data
public class ApplicationConfig {

  @Getter private static String appId;
  @Getter private static String evn;

  public static boolean isTest() {
    return StrUtil.equals("test", getEvn());
  }

  @Value("${app.env}")
  public void setEvn(String evn) {
    ApplicationConfig.evn = evn;
  }

  @Value("${app.id}")
  public void setAppId(String appId) {
    ApplicationConfig.appId = appId;
  }
}
